<template>
  <j-select-biz-component :width="1000" :name="name" :multiple='false' :inputs="inputs" :searchIcon='searchIcon' :selectButtonText="selectButtonText"  v-bind="configs" v-on="$listeners"/>
</template>

<script>
import JSelectBizComponent from './JSelectBizComponent'

export default {
  name: 'JSelectDatabase',
  components: { JSelectBizComponent },
  props: {
    value: {
      type: String,
      default: ''
    },
    name: {
      type: String,
      default: '数据库配置'
    },
    selectButtonText:{
      type: String,
      default: '选择'
    },
    inputs:{
      type: Boolean,
      default: true
    },
    searchIcon:{
      type: String,
      default: 'search'
    },
  },
  data() {
    return {
      settings: {
        displayKey: 'databaseName',
        returnKeys: ['id', 'databaseName'],
        listUrl:   window._CONFIG['domianConfigURL']+'/genDataConfigController/findPageList',
        queryParamCode: 'databaseName',
        queryParamText: '数据库',
        ellipsisLength:-1,
        columns: [
          // { title: '配置ID', field: 'id', align: 'left', width: '40%', widthRight: '70%' },
          { title: '数据库', field: 'databaseName', align: 'left', width: '50%' },
          { title: '用户', field: 'username', align: 'left', width: '50%' },
        ]
      }
    }
  },
  computed: {
    configs() {
      return Object.assign({ value: this.value }, this.settings, this.$attrs)
    }
  }
}
</script>

<style lang="less" scoped></style>
